﻿

namespace KinonekoSoftware.Foundation.UI.Controls.Buttons
{
    public class MoreButton : ForestButtonBase
    {


        
        public static readonly StyledProperty<bool> IsHorizontalProperty;

        static MoreButton()
        {
            IsHorizontalProperty = AvaloniaProperty.Register<MoreButton,bool>(nameof(IsHorizontal));
        }

        protected override void OnClick()
        {
            if(ContextMenu is not null)
            {
                ContextMenu.PlacementTarget = this;
                ContextMenu.Placement       = PlacementMode.Bottom;
                ContextMenu.Open();
            }
            base.OnClick();
        }

        public bool IsHorizontal
        {
            get => GetValue(IsHorizontalProperty);
            set => SetValue(IsHorizontalProperty, value);
        }
    }
}